﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                xmlns:local="clr-namespace:Inovout.Gui.Wpf.Controls"
          >

    <Style TargetType="{x:Type local:XMenu}">
        <Setter Property="DockPanel.Dock" Value="Top"/>
        <Setter Property="ItemsSource" Value="{Binding Menus}"/>
        <Setter Property="ItemContainerStyle">
            <Setter.Value>
                <Style>
                    <Setter Property="MenuItem.Header" Value="{Binding Header}"/>
                    <Setter Property="MenuItem.Command" Value="{Binding Command}"/>
                    <Setter Property="MenuItem.ItemsSource" Value="{Binding Items}"/>
                    <Style.Triggers>
                        <DataTrigger Binding="{Binding IsSeparator}" Value="true">
                            <Setter Property="MenuItem.Template">
                                <Setter.Value>
                                    <ControlTemplate TargetType="{x:Type MenuItem}">
                                        <Separator />
                                    </ControlTemplate>
                                </Setter.Value>
                            </Setter>
                        </DataTrigger>
                    </Style.Triggers>
                </Style>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>